:host{
    height: 100%;
    min-height: 100vh;
    overflow: hidden;
}
.board{
    background: var(--background-light);
    box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.05);
    z-index: -1;
    background-image: url("data:image/svg+xml,%3Csvg width='90' height='90' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23000000' fill-opacity='0.068' fill-rule='evenodd'%3E%3Ccircle cx='4' cy='4' r='1'/%3E%3C/g%3E%3C/svg%3E");
    &.infocus:hover{
        cursor: default;
    }
    &.moving{
        cursor: grab !important;
    }
}
.svg-canvas{
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.backdrop-centralized{
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.loading{
    gap: 1em;
    font-size: 2em;
    color: var(--text);
    img{
        animation: loadingAnim 1s ease-in-out infinite;
    }
}
.close{
    position: absolute;
    color: var(--text);
    top: 0.2em;
    right: 0.2em;
    border: 0;
    outline: none;
    background-color: transparent;
    cursor: pointer;
    font-size: 1.1em;
    &:hover{
        color: var(--text);
    }
}
.autosave{
    position: absolute;
    top: 3em;
    right: 1em;
    color: #fff;
    background-color: var(--main);
    width: 2em;
    height: 2em;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.35em;
    border-radius: 50%;
    opacity: 0.5;
    animation: autosave 1s ease-in-out;
}
.saved-boards{
    position: relative;
    min-width: 800px;
    max-width: 950px;
    color: var(--text);
    background-color: var(--background-light);
    padding: 1em;
    .title{
        text-align: center;
    }
    .note{
        font-size: 0.65em;
        font-weight: normal;
        text-align: center;
        display: block;
        color: var(--text);
    }
    .saved-boards-main-container{
        display: flex;
        gap: 0.5em;
    }
    .selected{
        outline: 0.2em solid var(--main) !important;
    }
    .saved-boards-main{
        margin-top: 1em;
        padding: 1em;
        flex-basis: 70%;
        display: flex;
        flex-flow: column nowrap;
        gap: 1em;
        max-height: 70vh;
        overflow-y: scroll;
        .saved-board{
            position: relative;
            transition: filter 0.2s ease-in-out;
            outline: 0.1rem solid var(--background-dark);
            cursor: pointer;
            &:hover{
                filter: brightness(80%);
            }
            .saved-board-title{
                position: absolute;
                top: 0.3em;
                right: 0.5em;
                color: var(--text);
            }
        }
    }
    .saved-boards-side{
        display: flex;
        flex-flow: column;
        gap: 0.5em;
        padding: 0.5em;
        flex-grow: 1;
        color: var(--text);
        .selected-title{
            font-size: 1.1em;
            text-align: center;
            display: block;
        }
        .selected-info{
            font-size: 0.85em;
            .highlight{
                color: var(--main);
            }
        }
        .selected-actions{
            margin-top: auto;
            margin-bottom: auto;
            align-self: center;
            display: flex;
            gap: 1.4em;
            button{
                font-size: 0.9em;
                font-weight: normal;
                border: 0;
                outline: 0;
                padding: 0.3em 1em;
                color: #fff;
                border-radius: 0.1em;
                cursor: pointer;
                &.delete{
                    background-color: rgb(184, 37, 37);
                }
                &.load{
                    background-color: var(--main);
                }
                &:disabled{
                    filter: grayscale(100%);
                    cursor: not-allowed;
                }
            }
        }
    }
}
.saved-boards-popup{
    position: fixed;
    top: 100px;
    background-color: var(--background-light);
    font-size: 0.8em;
    right: 0;
    display: flex;
    color: var(--text);
    border: 0.1rem solid var(--border);
    transition: transform 0.4s ease-in-out;
    &:hover{
        transform: translateX(0) !important;
    }
    .hidden{
        width: 1.75em;
        display: flex;
        justify-content: center;
        align-items: center;
        color: #fff;
        font-weight: bold;
        font-size: 1.25em;
        background-color: var(--main);
    }
    .show{
        padding: 0.5em 1em;
    }
    button{
        margin-left: 0.5em;
        width: 80px;
        outline: 0;
        border: 0;
        padding: 0.5em 0.5em;
        color: #fff;
        background-color: var(--main);
        cursor: pointer;
        transition: filter 0.1s linear;
        &:hover{
            filter: brightness(1.25);
        }
    }
}
.read-only-controls{
    position: absolute;
    bottom: 0.5em;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    width: max-content;
    margin: 0 auto;
    .controls{ 
        display: flex;
        gap: 0.5em;
        transition: background-color 0.2s ease-in-out;
        padding: 0.5em 1em;
        border-radius: 2em;
        background-color: var(--background-dark);
        border: 0.15rem solid var(--border);
        &:hover{
            background-color: var(--background);
        }
        button, a{
            border: 0;
            font-size: 1.5rem;
            outline: none;
            padding: 0.2em;
            background-color: transparent;
            color: var(--text);
            cursor: pointer;
            &:hover, &:focus{
                outline: 0;
            }
        }
    }
}
.read-only-watermark{
    position: absolute;
    left: 1em;
    bottom: 0.5em;
    color: var(--text);
    opacity: 0.5;
    font-weight: 100;
    font-size: 12px;
    a{
        text-decoration: underline;
        &:hover{
            color: var(--main)
        }
    }
}
.read-only-tip{
    position: absolute;
    top: 0.5em;
    left: 0.5em;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 1.5em;
    height: 1.5em;
    background: var(--main);
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
}
.context-menu{
    position: absolute;
    z-index: 140;
    background-color: var(--background);
    border: 0.15rem solid var(--border);
    color: var(--text);
    font-size: 0.9rem;
    transform-origin: top left;
    white-space: nowrap;
    .menu{
        display: flex;
        flex-direction: column;
        .item{
            padding: 0.75em 1em;
            flex-grow: 1;
            cursor: pointer;
            &:hover{
                background-color: var(--background-dark);
            }
        }
        .line{
            margin: 0 auto;
            width: 80%;
            background-color: var(--text);
            border-color: var(--text);
            opacity: 0.1;
        }
    }
}
.simulation-card{
    position: absolute;
    width: 240px;
    height: 120px;
    z-index: 15;
    transform: translate(calc(-50% + 40px), calc(-100% - 20px - 20px));
    color: var(--text);
    background-color: var(--background-dark);
    border: 2px solid var(--border);
    font-size: 11px;
    padding: 5px;
    .card-top{
        .title{
            display: block;
            text-align: center;
            font-size: 12px;
            small{
                color: var(--text-light);
                font-size: 10px;
            }
        }
    }
    .card-body{
        margin-top: 10px;
        p{
            margin-bottom: 4px;
        }
    }
    .svg-meter{
        position: absolute;
        top: 4px;
        left: 4px;
        .hand{
            stroke: var(--text);
            stroke-width: 2;
            stroke-linecap: round;
            transform-origin: 12px 12px;
            transition: transform 0.1s linear;
        }
    }
    .close{
        position: absolute;
        top: 4px;
        right: 4px;
        font-size: 12px;
        &:hover{
            color: var(--main);
        }
    }
    &::after{
        content: "";
        display: block;
        position: absolute;
        bottom: -20px;
        left: 85px;
        border-left: 15px solid transparent;
        border-right: 15px solid transparent;
        border-top: 20px solid var(--background-dark);
    }
}


@keyframes loadingAnim {
    0%{
        transform: scale(0.9);
    }
    50%{
        transform: scale(1.1);
    }
    100%{   
        transform: scale(0.9);
    }
}
@-moz-keyframes loadingAnim {
    0%{
        transform: scale(0.9);
    }
    50%{
        transform: scale(1.1);
    }
    100%{   
        transform: scale(0.9);
    }
}

@keyframes autosave {
    0%{
        opacity: 0;
    }
    50%{
        opacity: 0.8;
    }
    100%{   
        opacity: 0;
    }
}
@-moz-keyframes autosave {
    0%{
        opacity: 0;
    }
    50%{
        opacity: 0.8;
    }
    100%{   
        opacity: 0;
    }
}
